package xin.marcher.module.common.enums.quality;

import xin.marcher.module.common.exception.BaseErrorCodeEnum;

/**
 * 库存相关的异常枚举码
 */
public enum QualityExceptionCode implements BaseErrorCodeEnum {
    /**
     * SQL执行异常
     */
    INVENTORY_SQL("6000", "SQL执行异常"),

    /**
     * 参数校验失败
     */
    PARAM_CHECK_ERROR("6001", "参数校验失败:{0}"),

    /**
     * 重复添加同一条数据
     */
    DATA_DUPLICATION_ERROR("6002", "数据添加出错，数据重复"),
    ;


    private final String errorCode;
    private final String errorDesc;

    QualityExceptionCode(String errorCode, String errorDesc) {
        this.errorCode = errorCode;
        this.errorDesc = errorDesc;
    }

    @Override
    public String toString() {
        return errorCode + "-" + errorDesc;
    }

    @Override
    public String getErrorCode() {
        return errorCode;
    }

    @Override
    public String getErrorMsg() {
        return errorDesc;
    }
}
